package com.sky.task;

import com.sky.server.WebSocketServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author liudo
 * @version 1.0
 * @project sky-take-out
 * @date 2024/2/25 16:14:24
 */
// @Component
public class ReplyMsgTask {
    @Autowired
    private WebSocketServer webSocketServer;

    @Scheduled(fixedRate = 1000L)
    public void replyMsg() {
        webSocketServer.sendToAllClient("来自服务端的消息 Over!");
    }
}
